const promise1 = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve("success");
  }, 1000);
});

const promise2 = promise1.then(() => {
  throw new Error("error!!!");
});

console.log("promise1", promise1);

console.log("promise2", promise2);

setTimeout(() => {
  console.log("promise1", promise1);
  console.log("promise2", promise2);
}, 2000);

// promise1 Promise<pending>
// promise2 Promise<pending>
// 没有catch来接收Error, 会出现一个报错
// promise1 Promise<resolve> success => 里面resolve的确实是success, 但是在这里又resolve(new Error('error!!!!'))
// promise2 Promise<resolve> Error: error
